require 'rubygems'
gem 'soap4r'
require 'soap/wsdlDriver'
require 'soap/header/simplehandler'
require 'defaultDriver.rb'
require 'authStub.rb'

#Async create options
#options = CreateOptions.new(nil,nil,nil,nil,nil,nil,nil,nil,'Asynchronous')
options = nil

customerKey = 'API-Test-1'
desc = customerKey + ' created through the API'
query = "SELECT s.FirstName, s.EmailAddress FROM APITestDe0 s WHERE s.EmailAddress LIKE '%bh.exacttarget.com'"
queryDef = QueryDefinition.new(nil,nil,nil,nil,nil,nil,nil,customerKey,nil,nil,customerKey,desc,nil,nil,query,'DE',InteractionBaseObject.new(nil,nil,nil,nil,nil,nil,nil,'APITestDe1',nil,nil,'APITestDe1',nil,nil),'Overwrite',nil,nil,nil)
apiObj = queryDef

resp = $driver.create(CreateRequest.new(options,[*apiObj]))